package ar.edu.unlam.tpfinal.model;

public enum TransactionStatus {
	STARTED("Empezado"),
	PAUSED("Pausado"),
	HOLDED("Retenido"),
	REJECTED("Rechazado"),
	FINISHED("Finalizado");
	
	private String statusName;

	TransactionStatus(String statusName) {
		this.statusName = statusName;
	}
	
	public String getStatusName() {
		return statusName;
	}
	
	@Override
	public String toString() {
		return statusName;
	}
	
	public static TransactionStatus valueFromString(String name){
		TransactionStatus transactionStatus[] = TransactionStatus.values();
		for (TransactionStatus status : transactionStatus) {
			if(status.statusName.equals((name))){
				return status;
			}
		}
		return null;
	}
}
